using System.Data;
using ET;
namespace DAL
{
    public class Income_Expenditure_Method_DAL
    {
        private readonly clsConnect cls = new clsConnect();

        #region Getdata
        public DataTable BindGirdtb_Income_Expenditure_Method(string keywords)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@KeyWords", keywords);
            return cls.GetData("sp_tb_Income_Expenditure_Method_Search");
        }
        public DataTable BindGirdtb_Income_Expenditure_MethodDetail(int id)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Income_Expenditure_Method_ID", id);
            return cls.GetData("sp_tb_Income_Expenditure_Method_Detail");
        }
        #endregion

        #region Insert
        public bool Inserttb_Income_Expenditure_Method(Income_Expenditure_Method_ET data)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Income_Expenditure_Method_Alias", data.Income_Expenditure_Method_Alias);
            cls.AddParameter("@Income_Expenditure_Method_Name", data.Income_Expenditure_Method_Name);
            cls.AddParameter("@Income_Expenditure_Method_Note", data.Income_Expenditure_Method_Note);
            cls.AddParameter("@Income_Expenditure_Method_User_Add", data.Income_Expenditure_Method_User_Add);
            cls.AddParameter("@Income_Expenditure_Method_Date_Add", data.Income_Expenditure_Method_Date_Add);
            cls.AddParameter("@Income_Expenditure_Method_Computer_Add", data.Income_Expenditure_Method_Computer_Add);
            return cls.ExecuteNonQuery("sp_tb_Income_Expenditure_Method_Insert");
        }
        #endregion

        #region Update
        public bool Updatetb_Income_Expenditure_Method(Income_Expenditure_Method_ET data)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Income_Expenditure_Method_ID", data.Income_Expenditure_Method_ID);
            cls.AddParameter("@Income_Expenditure_Method_Alias", data.Income_Expenditure_Method_Alias);
            cls.AddParameter("@Income_Expenditure_Method_Name", data.Income_Expenditure_Method_Name);
            cls.AddParameter("@Income_Expenditure_Method_Note", data.Income_Expenditure_Method_Note);
            cls.AddParameter("@Income_Expenditure_Method_User_Modify", data.Income_Expenditure_Method_User_Modify);
            cls.AddParameter("@Income_Expenditure_Method_Date_Modify", data.Income_Expenditure_Method_Date_Modify);
            cls.AddParameter("@Income_Expenditure_Method_Computer_Modify", data.Income_Expenditure_Method_Computer_Modify);
            return cls.ExecuteNonQuery("sp_tb_Income_Expenditure_Method_Update");
        }
        #endregion

        #region Delete
        public bool Deletetb_Income_Expenditure_Method(int id)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Income_Expenditure_Method_ID", id);
            return cls.ExecuteNonQuery("sp_tb_Income_Expenditure_Method_Delete");
        }
        #endregion
    }
}